import httpRequest from "@/axios/index.js"

/**
 * 查询所有权限-树结构
 */
 export function queryTreeAllReq(){
    return httpRequest({
        url:"/sys/perm/query/tree/all",
        method:"get"
    })
}

/**
 * 查询目录和菜单权限-树结构
 */
export function queryTreeMenuReq(){
    return httpRequest({
        url:"/sys/perm/query/tree/menu",
        method:"get"
    })
}

/**
 * 添加权限
 */
 export function addReq(data){
    return httpRequest({
        url:"/sys/perm/add",
        method:"post",
        data:data
    })
}

/**
 * 修改权限
 */
 export function updateReq(data){
    return httpRequest({
        url:"/sys/perm/update",
        method:"put",
        data:data
    })
}

/**
 * 删除权限
 */
 export function deleteReq(id){
    return httpRequest({
        url:"/sys/perm/delete/"+id,
        method:"delete"
    })
}

/**
 * 查询角色已经拥有的权限
 */
 export function getPermIdsByRoleIdReq(roleId){
    return httpRequest({
        url:"/sys/perm/query/permIdsByRoleId/"+roleId,
        method:"get"
    })
}